
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>添加出行人</title>
    <link rel="stylesheet" href="../../../css/aui.css" />
    <link rel="stylesheet" href="../../../css/iconfont/iconfont.css" />
    <link rel="stylesheet" href="../../../script/widget/mobiscroll/mobiscroll.custom-3.0.0-beta6.min.css" />
    <link rel="stylesheet" href="../../../css/index/train/select_birthday.css" />
</head>
<body style="cursor: pointer">
<header class="aui-bar aui-bar-nav" id="header">
    <div class="aui-pull-left aui-btn">
        <span class="aui-iconfont aui-icon-left" onclick="closeWin()"></span>
    </div>
    <div class="aui-title">添加出行人</div>
    <div class="aui-pull-right aui-btn" onclick="add()">完成</div>
</header>

</body>
</html>
<script type="text/javascript" src="../../../script/aui/api.js"></script>
<script type="text/javascript" src="../../../script/aui/aui-dialog.js" ></script>
<script src="../../../script/extend/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../../script/widget/mobiscroll/mobiscroll.custom-3.0.0-beta6.min.js" ></script>
<script type="text/javascript" src="../../../script/extend/parsley/dist/parsley.remote.min.js"></script>
<script type="text/javascript" src="../../../script/extend/parsley/src/i18n/zh_cn.js"></script>
<script src="../../../script/config.js"></script>
<script type="text/javascript" src="../../../script/common.js"></script>

<script type="text/javascript">
    apiready = function() {
        api.parseTapmode();
        initHeader('select_birthday');
        //设置沉浸式
        var header = $api.byId('header');
        $api.fixStatusBar(header);
        var contentHead = api.winHeight - $api.byId('header').offsetHeight;
        api.openFrame({
            name: 'select_birthday_frm',
            url: './select_birthday_frm.html',
            rect: {
                x: 0,
                y: $api.byId('header').offsetHeight,
                w: 'auto',
                h: contentHead
            },
            pageParam: {
                name: 'test'
            },
            bounces: true,
            bgColor: 'rgba(0,0,0,0)',
            vScrollBarEnabled: true,
            hScrollBarEnabled: true
        });

    };
    function add(){
        if (!$('#myform').parsley().validate()){
            return false;
        }

        var userName  = $("#userName").val();
        var scroller  = $("#scroller").val();
        var papers    = $("#papers").val();
        var mobile    = $('#mobile').val();
        var card_type = $('#card_type').val();

        var param={};
        param.url = Config.api.Add_travelers;
        param.data = {name:userName,mobile:mobile,card_type:card_type,card_number:papers,birthday:scroller};
        ajax(param,function(data){
            if (data.code == 1) {
                clearAllCookie();
                //跳转页面
                openWin('train_people', './train_people_win.html');
            } else {
                alert(data.msg);
            }
        })
    }
</script>
